package cn.iocoder.yudao.module.trade.framework.delivery.core.client.convert;

import cn.iocoder.yudao.module.trade.controller.admin.delivery.vo.wxexpress.ExpressCreateReqVO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemDO;
import cn.iocoder.yudao.module.trade.dal.dataobject.order.TradeOrderItemOtherDO;
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.wxexpress.WxExpressCreateDTO;
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.wxexpress.wxExpressCreate.GoodsDetailDTO;
import cn.iocoder.yudao.module.trade.framework.delivery.core.client.dto.wxexpress.wxExpressCreate.ReceiverDTO;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.Mappings;
import org.mapstruct.factory.Mappers;

import java.util.List;

@Mapper
public interface WxExpressConvert {

    WxExpressConvert INSTANCE = Mappers.getMapper(WxExpressConvert.class);

    WxExpressCreateDTO convert(ExpressCreateReqVO reqVO);

    @Mappings(value = {
            @Mapping(source = "receiverName", target = "name"),
            @Mapping(source = "receiverDetailAddress", target = "address"),
            @Mapping(source = "receiverMobile", target = "mobile")
    })
    ReceiverDTO convertReceiver(TradeOrderDO order);

    List<GoodsDetailDTO> convertGoodsList(List<TradeOrderItemDO> orderItemList);
}
